import java.io.*;
import java.util.*;

import Utiles.DataFactory;

import diana.DSolver;

import walter.WSolver;

import Algoritmos.*;

public class EntryPoint {
	
	public static void main(String[] args){
		LinkedList<Simulator> simulators = new LinkedList<>();
		if(contiene(args, "walter"))
			simulators.add(new Simulator(new WSolver()));
		if(contiene(args, "diana"))
			simulators.add(new Simulator(new DSolver()));

		for(Simulator simulator : simulators){
			InputStream inputStream;
			long start = System.currentTimeMillis();
			try {
				//inputStream =System.in;
				inputStream = (new FileInputStream( new File( "input.txt" ) ) );
				simulator.run( inputStream );
				inputStream.close();
			} catch (Exception e) {
				e.printStackTrace();
			}
			long end = System.currentTimeMillis();
			System.out.println("tiempo en milisengundos: " + (end - start));
			
		}
		
	}
	
	private static boolean contiene(String[] strings, String s){
		for(String string : strings)
			if(string.equals(s)) return true;
		return false;
	}
}
